nethackfandomcom-20200214-history
IBMgraphics
IBMgraphics is an option that displays walls as continuous lines rather than as broken dashes, which is the best that plain ASCII can do. It also displays certain dungeon features with distinct symbols, and on some systems makes the Rogue level look more like the Epyx version of Rogue. IBMgraphics requires a display device that displays code page 437, or a compatible code page. Many users of Microsoft Windows outside the United States have their terminals set to another code page, often code page 850, and this can affect the appearance of some symbols. The complete symbol list Normal dungeon The complete symbol list for the normal dungeon is found in the array ibm_graphics in drawing.c. The corresponding ASCII symbols are in defsyms. Those symbols affected by IBMgraphics are listed here. |- |0xFA||Room, doorway, ice, open drawbridge||·||. |- |0xFE||Open door||■||| or - |- |} Rogue level Certain objects have their appearance changed in the Rogue level; the array IBM_r_oc_syms governs this. The exact changes are different on Linux than on MS-DOS and its descendants. The list here shows the more complete list used on MS-DOS. A number of map symbols are also changed and all creatures otherwise appearing as @ instead appear as ☺. Code page compatibility There are code pages other than 437 that will also display IBMgraphics correctly, because they differ only at code points that are not currently used by NetHack. These include 860 (Portuguese), 861 (Icelandic), 862 (Hebrew), and 865 (Nordic), and can be useful when code page 437 is unavailable. Some other code pages will not quite display IBMgraphics perfectly, but are close enough to be usable when none of the above code pages are available. Some of these are shown in the table below. For code page 858, use the column for code page 850. Other known code pages have few of the necessary symbols and are completely unsuitable for IBMgraphics. Configuring Code Page 437 On many platforms, it is possible to set the display device to display code page 437 instead of the default code page. This will enable NetHack to display the IBMgraphics as the DevTeam intended. MS-DOS and Windows 95, 98, and Me Make sure CONFIG.SYS contains a line similar to this: C:\WINDOWS\COMMAND\display.sys con=(ega,,1) and AUTOEXEC.BAT contains lines similar to these: mode con codepage prepare=((437) C:\WINDOWS\COMMAND\ega.cpi) mode con codepage select=437 For MS-DOS substitute C:\DOS for C:\WINDOWS\COMMAND in both places. Windows NT, 2000, XP, and Vista This section may also apply to Windows 2003 Server, but is untested on this version. If code page 437 is not the default, it will be necessary either to configure the console window to use the Lucida Console font, or to run full screen (press Alt-Enter). With bitmap fonts in a window, only the characters for the default code page are loaded, and others do not display correctly. Bug W343-3 is also a problem for this configuration. Once either Lucida Console is set, or the console window is in full screen mode, it is sufficient to type chcp 437 and possibly for full-screen mode mode con lines=25 and then start NetHack. PuTTY On the PuTTY Configuration window (this appears when you first start PuTTY), select "Translation" under the "Window" configuration in the pane on the left. Then, in the pulldown menu marked "Received data assumed to be in which character set", select "CP437". You can then log in to the server as usual. You may also change this setting and then 'save' the session. The characater set (as well as other display settings, e.g., the color blue) will be used in your session from the on. Linux Console If your system uses a unicode console, disable it (for the current session) with: unicode_stop Then re-load the default text font with one of the two following commands: Debian-based systems: consolechars -m cp437 -f default8x16 Redhat-based systems, others: setfont default8x16 Finally, you may need to load the CP437 translation mode: setfont -m cp437 If any of these commands fails, try running it as root by preceding each command with "sudo " (e.g., "sudo unicode_stop"). FreeBSD Console Load the CP437 console font with: vidcontrol -f 8x16 cp437-8x16 Or add this to /etc/rc.conf to make it permanent: font8x16="cp437-8x16" X11 While most terminal programs for X11 readily support DECgraphics, they need additional setup for IBMgraphics. The usual way is to set the encoding to code page 437. The exact procedure to do this depends on the terminal program. You also need a font that provides the necessary characters. X11 already provides at least one such font: the "fixed" font. It is already the default font for xterm. To preview it or to check that you have it, use one of these xfd commands: # to preview it as a core font xfd -fn -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1 # to preview it as an Xft font xfd -fa Fixed-10 If you choose a font like Bitstream Vera Sans Mono, then X11 may substitute another font for some characters, causing graphical glitches if the two fonts have different monospace metrics. Using konwert or filterm (any terminal) If your terminal supports UTF-8, but not code page 437, you can use konwert or filterm to transcode NetHack's output into something your terminal understands. Invoke one of them as follows: # local play nethack | konwert cp437-utf8 filterm ascii-ascii cp437-utf8 nethack # remote play telnet nethack.alt.org | konwert cp437-utf8 filterm ascii-ascii cp437-utf8 telnet nethack.alt.org You will probably need to install these programs before they can be used. xterm The current xterm does not provide an encoding for code page 437, but it does provide a charset "CP 437" which represents the upper half of (0x80 - 0xff) of CP 437. We can invoke luit manually to set up a Extended Unix Code that maps 0x00 - 0x7f to ASCII and 0x80 - 0xff to CP 437. To open an xterm using CP 437: * Use uxterm -fg gray -bg black to open an xterm using UTF-8, with a gray-on-black color scheme that works well with IBMgraphics. ** The default font (fixed) looks nice, but you can set it explicitly with either -fn fixed or -fa Fixed-10. * Inside that xterm, invoke luit -g2 'CP 437' ** You might need luit -gr g2 -g2 'CP 437' if your current locale defaults to -gr g1 When you invoke luit, it starts a new shell (from where you may start NetHack). When you exit your CP 437 shell, luit exits and you return to your UTF-8 shell. . Click image for details.]] Unfortunately, your xterm will have serious graphical glitches at the Rogue level, because unlike a real IBM PC, luit does not map ASCII control characters to graphical characters (such as 0x01 to a smiley face adventurer). You may need to disable IBMgraphics while playing the Rogue level. You can also install a CP437 or "VGA" font. There are several of these floating around the net; a nice one is included with bochs-2.0. Konsole (KDE) KDE does not have an encoding for code page 437, or any similar encoding. In menu Settings -> Encoding, if you select "Cyrillic (ibm866)" or "Western European (ibm850)", then the encoding will the walls, floors, doors and corridors for IBMgraphics, but fountains and moats will look strange. A better option is to select "Unicode (utf8)", then invoke luit as you would in an xterm. To configure Konsole for IBMgraphics: * Use Settings -> Font -> Select... to pick a good font, such as "Fixed Misc" size "10" (or any size). ** Optionally, use Settings -> Size to resize your terminal for the new font. * Select Settings -> Schema -> Linux Colors for a good gray-on-black look. * Select Settings -> Encoding -> Unicode (utf8). Alternatively, start Konsole in a UTF-8 locale, so that the Default encoding is also UTF-8. ** Optionally, now use Settings -> Save Sessions Profile... and call the profile something like "ibm". * At the command line, invoke luit -g2 'CP 437' When you invoke luit, it starts a new shell (from where you may start NetHack). When you exit your CP 437 shell, luit exits and you return to your UTF-8 shell. If you saved an "ibm" profile, then konsole -profile ibm will start a Konsole with the same settings. You still need to invoke luit -g2 'CP 437' before you start NetHack with IBMgraphics. If you add a "Terminal Sessions" applet to your KDE panel, you can also access your profile with Terminal Sessions -> New Session Using Profile -> ibm. Unfortunately, your Konsole will have serious graphical glitches at the Rogue level. This happens if you set Konsole to utf-8 and use luit, or if you set Konsole to ibm850 or ibm866 and do not use luit. Either way, the software will not map ASCII control characters to graphical characters. You may need to disable IBMgraphics while playing the Rogue level. gnome-terminal The current gnome-terminal does not have a setting for code page 437, but it does support other code pages that are equivalent for NetHack's purposes, such as 862 (Hebrew). To set code page 862 on gnome-terminal: * Select Terminal, Set Character Encoding, and then Add or Remove. * In the pane on the left, select the line with description Hebrew and encoding IBM862. * Click the right-pointing arrow between the two panes. * Click Close. The above steps only need to be done once for the lifetime of the Gnome installation. Once done, it is sufficient to: * Select Terminal, Set Character Encoding, and then Hebrew (IBM862). It should be noted that the current default gnome-terminal font in Ubuntu Jaunty fully supports DECgraphics as long as eight_bit_tty is set to false. Custom Map Symbols Some users may prefer to set their own symbols, either because they don't like the existing ones, or because it's easier than setting code page 437 just to play NetHack. See Custom map symbols for further details. UTF-8 support A user has posted an experimental patch to RGRN (here's what it changes) allowing display of the IBMgraphics characters using UTF-8, rather than a special code page. Compatible terminals include the Linux console for kernels since 1.2.1, any Unix-like platform running a recent version of X11, and PuTTY for Windows users accessing public servers. The original is a patch against NetHack 3.4.0; Stephen Anthony Uy has adapted it for 3.4.3. References Category:Options